home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
DATABASE
/
BF10A.ZIP
/
BTNF1.111
/
BUTNFILE.MST
< prev
next >
Wrap
Text File
|
1993-08-01
|
10KB
|
346 lines
'**************************************************************************
'* MSSetup Toolkit Sample 1
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST TOOBIG = 6300
CONST BADPATH = 6400
CONST USERCONFIRM = 7300
CONST USERNAME = 7500
CONST NONAME = 7700
CONST NOORG = 7800
CONST WIN30HELP = 8000
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL OPTCUR$ ''Option selection from option dialog.
'DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "buttonFile Shareware Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
DEST$ = "C:\butnfile"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
GET30HELPINSTALL:
Win30Hlp$ = "NO"
IF GetWindowsMajorVersion() <= 3 THEN
IF GetWindowsMinorVersion() < 10 THEN
sz$ = UIStartDlg(CUIDLL$, WIN30HELP, "FInfoDlgProc", 0, "")
UIPop 1
IF sz$ = "CONTINUE" THEN
Win30Hlp$ = "YES"
ELSE
Win30Hlp$ = "NO"
ENDIF
ENDIF
ENDIF
GETUSERNAME:
'** GETUSERNAME1:
'** sz$ = UIStartDlg(CUIDLL$, USERNAME, "FNameOrgDlgProc", 0, "")
'** USERNAMES$ = GetSymbolValue("NameOut")
'** USERORGS$ = GetSymbolValue("OrgOut")
'**
'** IF sz$ = "CONTINUE" THEN
'** IF USERNAMES$ ="" THEN
'**
'** sz$ = UIStartDlg(CUIDLL$, NONAME, "FInfoDlgProc", 0, "")
'** UIPop 1
'** GOTO GETUSERNAME1
'**
'** END IF
'** ELSEIF sz$ = "EXIT" THEN
'** UIPop 1
'** ERROR STFQUIT
'** GOTO QUIT
'** ELSEIF sz$ = "CANCEL" THEN
'** UIPop 1
'** ERROR STFQUIT
'** GOTO QUIT
'** ELSEIF sz$ = "BACK" THEN
'** UIPop 1
'** GOTO GETPATH
'** ELSE
'** GOSUB ASKQUIT
'** GOTO GETPATH
'** END IF
'**
'** ' clear symbol then add list items
'** SetSymbolValue "ConfirmTextIn", ""
'** AddListItem "ConfirmTextIn", USERNAMES$
'** AddListItem "ConfirmTextIn", USERORGS$
GETUSERNAME2:
'** sz$ = UIStartDlg(CUIDLL$, USERCONFIRM, "FConfirmDlgProc", 0, "")
'** IF sz$ = "CONTINUE" THEN
'** UIPop 1
'** ELSEIF sz$ = "EXIT" THEN
'** UIPop 1
'** ERROR STFQUIT
'** GOTO QUIT
'** ELSEIF sz$ = "CANCEL" THEN
'** UIPop 1
'** ERROR STFQUIT
'** GOTO QUIT
'** ELSEIF sz$ = "BACK" THEN
'** UIPop 1
'** GOTO GETUSERNAME
'** ELSE
'** GOSUB ASKQUIT
'** GOTO GETPATH
'** END IF
' pop entry dialog
UIPop 1
GOSUB INSTALL
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
INSTALL:
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
'OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
'WriteToLogFile ""
'WriteToLogFile " User chose as destination directory: '" + DEST$ + "'"
'WriteToLogFile " User chose option: '" + OPTCUR$ + "'"
'WriteToLogFile ""
'WriteToLogFile "May have had to create the directory: " + DEST$
'WriteToLogFile ""
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
IF GetWindowsMajorVersion() <= 3 THEN
IF GetWindowsMinorVersion() < 10 THEN
AddSectionFilesToCopyList "Files30", SrcDir$, GetWindowsSysDir()
ENDIF
ENDIF
IF Win30Hlp$ = "YES" THEN
'RenameFile GetWindowsSysDir()+"WINHELP.EXE","WINHELP.300"
AddSectionFilesToCopyList "Files30Help", SrcDir$, GetWindowsSysDir()
ENDIF
AddSectionFilesToCopyList "DLLFiles", SrcDir$, GetWindowsSysDir()
IF GetCopyListCost(extra$, cost$, needed$) > 0 THEN
GOSUB TOOBIG
ELSE
CopyFilesInCopyList
IF USERNAMES$ = "" THEN
USERNAMES$ = " "
ENDIF
StampResource "Files", "BUTNFILE", DEST$, 400, 400, "Unregistered Shareware Version", 31
IF USERORGS$ = "" THEN
USERORGS$ = " "
ENDIF
StampResource "Files", "BUTNFILE", DEST$, 400, 401, "Choose 'Register...' on the menu bar.", 38
'// Create Progman group and icons
CreateProgmanGroup "buttonFile Shareware", "", cmoNone
ShowProgmanGroup "buttonFile Shareware", 1, cmoNone
CreateProgmanItem "buttonFile Shareware", "buttonFile Shareware", MakePath(DEST$,"butnfile.exe"), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "Read Me 1st", "notepad.exe "+MakePath(DEST$,"readme.1st"), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "Read Me 2nd", "notepad.exe "+MakePath(DEST$,"read.me"), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "User Response Form", "notepad.exe "+MakePath(DEST$,"response."), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "ButtonWare Products", "notepad.exe "+MakePath(DEST$,"products."), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "Program Descriptions", "notepad.exe "+MakePath(DEST$,"describe.doc"), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "License Information", "notepad.exe "+MakePath(DEST$,"license.doc"), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "Vendor Information", "notepad.exe "+MakePath(DEST$,"vendor.doc"), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "BBS Information", "notepad.exe "+MakePath(DEST$,"sysop.doc"), "", cmoOverwrite
CreateProgmanItem "buttonFile Shareware", "Educational Information", "notepad.exe "+MakePath(DEST$,"educate.doc"), "", cmoOverwrite
'// UPDATE WIN.INI FILE TO RECOGNIZE BTN EXTENSION
CreateIniKeyValue "WIN.INI", "Extensions", "btn", MakePath(DEST$,"BUTNFILE.EXE")+" ^.BTN", cmoNo